home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / CUGUK / PROG_TOO / C013.ZIP / PWD.C < prev    next >
Text File  |  1990-01-19  |  1KB  |  43 lines

  1. /********************************************************************
  2.  * C Users Group (U.K) C Source Code Library File CUGLIB.013        *
  3.  * Inquiries to: M. Houston, 36 Whetstone Clo. Farquhar Rd.         *
  4.  * Edgbaston, Birmingham B15 2QN ENGLAND                *
  5.  ********************************************************************
  6.  * File name: pwd.c
  7.  * Program name:pwd 
  8.  * Source of file: Ron Wellstead
  9.  * Purpose: An MS-DOS copy of the UNIX utility of the same name.
  10.  * Changes: <who what when & why major changes have been made>      
  11.  ********************************************************************/
  12.  
  13. /*
  14.  *
  15.  *    @(#) pwd.c 1.2 87/07/27 
  16.  *
  17.  *    UNIX style pwd utility for dos
  18.  *
  19.  *    copyright (c) 1987 Ron Wellsted.
  20.  *    This software is provided on the understanding that it is
  21.  *    NOT to be used for commercial gain. It may be freely distributed
  22.  *    in source or object form among amateur and hobby computer users ONLY!
  23.  *
  24.  *    prints the current directory on stdout
  25.  *    written for Microsoft C.
  26.  */
  27. #include    <stdio.h>
  28. #include    <direct.h>
  29. #include    <stdlib.h>
  30.  
  31. char buffer[129]="@(#)pwd.c VR 1.0.0 15 Jul 1987";
  32.  
  33. main()
  34. {
  35.     if (getcwd(buffer,128)==NULL)
  36.     {
  37.         perror("pwd");
  38.         exit(1);
  39.     }
  40.     printf("%s\n",buffer);
  41.     exit(0);
  42. }
  43.